package com.example.hotelmanagement.service.impl;

import com.example.hotelmanagement.entity.Order;
import com.example.hotelmanagement.mapper.OrderMapper;
import com.example.hotelmanagement.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderMapper orderMapper;

    @Override
    public List<Order> findAll() {
        return orderMapper.findAll();
    }

    @Override
    public Order findById(Integer orderId) {
        return orderMapper.findById(orderId);
    }

    @Override
    public List<Order> findByReservationId(Integer reservationId) {
        return orderMapper.findByReservationId(reservationId);
    }

    @Override
    public List<Order> findByStatus(String status) {
        return orderMapper.findByStatus(status);
    }

    @Override
    public int save(Order order) {
        return orderMapper.insert(order);
    }

    @Override
    public int update(Order order) {
        return orderMapper.update(order);
    }

    @Override
    public int delete(Integer orderId) {
        return orderMapper.delete(orderId);
    }
}